using UnityEngine;

public class Carrion : MonoBehaviour, IFood
{
	[Header("Requirement")]
	public Creature creature;

	public Food food;

	public Food Eat()
	{
		if (creature is Player)
		{
			creature.SetHealth(-40f);
		}
		else
		{
			creature.Death();
		}
		return food;
	}

	public bool IsDangerous(Creature other)
	{
		return creature.meatEater && other.GetSize() < creature.GetSize() && !creature.untouchable;
	}

	public bool IsEatable(Creature other)
	{
		return other.GetSize() > creature.GetSize() && !creature.untouchable && other.meatEater;
	}

	public Vector2 GetPosition()
	{
		return creature.rigidbody.position;
	}

	public float GetSize()
	{
		return creature.GetSize() + 3;
	}
}
